<?php
/**
 * Created by PhpStorm.
 * User: AdministratorNewYear
 * Date: 2018/12/18
 * Time: 15:15
 */
namespace utils;

class Error
{
    protected $code;
    protected $msg;
    protected $result;

    public function __construct($data = [])
   {
        // dd($data['result']);
        if (!empty($data['msg'])){
            $this->setMsg($data['msg']);
        }
        if (!empty($data['code'])){
            $this->setCode($data['code']);
        }
        if (!empty($data['result'])){
            $this->setResult($data['result']);
        }
    }

    /**
     * @return mixed
     */
    public function getMsg()
    {
        return $this->msg;
    }

    /**
     * @param mixed $msg
     */
    public function setMsg($msg)
    {
        $this->msg = $msg;
    }

    /**
     * @return mixed
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * @param mixed $code
     */
    public function setCode($code)
    {
        $this->code = $code;
    }

    /**
     * @return mixed
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * @param mixed $result
     */
    public function setResult($result)
    {
        $this->result = $result;
    }
}